package com.sky.wsp.rabbitmq.consumer;

import com.sky.wsp.rabbitmq.exchange.DirectExchangeConfig;
import com.sky.wsp.rabbitmq.po.MqMessage;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


@Component
public class DirectConsumer2 {
    @RabbitListener(queues = DirectExchangeConfig.QUEUE_NAME_2)
    public void displayMail(MqMessage msg) {
        System.out.println("<==Direct消费者2,监听routingKey=["
                + DirectExchangeConfig.ROUTING_KEY_2
                + ", "
                + DirectExchangeConfig.ROUTING_KEY_3
                + ",], 收到消息" + msg.toString());
    }
}
